import zmail

# mail_content = {
#     "subject": "success!",  # 邮件主题
#     "content_text": "This message from zmail", # 邮件内容
#     "attachments": r"my_test.yaml",  # 邮件附件
# }
#
# server = zmail.server("2783226718@qq.com", "dhrzoyadonwodfgf")
# server.send_mail(["2783226718@qq.com"], mail_content)

# with open(r"C:\TT\习知\自动化代码-4期\studyDemo01\reports-坚果\report-坚果.html", encoding='utf-8') as f:
#     content = f.read()
#
# mail_content = {
#     "subject": "success!",  # 邮件主题
#     # "content_text": content, # 邮件内容,文本内容
#     "content_html": content,
#     "attachments": "my_test.yaml",  # 邮件附件
# }
#
server = zmail.server("2783226718@qq.com", "dhrzoyadonwodfgf")
# server.send_mail(["2783226718@qq.com"], mail_content)
mail = server.get_latest()
print(mail)